Skip to content

Mount existing host directories in Docker services, tools, and validators - #5

Draft
petmal wants to merge 1 commit into
mainfrom
feat/container-bind-mounts
Draft

petmal wants to merge 1 commit into
mainfrom
feat/container-bind-mounts

Conversation

@petmal

@petmal petmal commented Nov 9, 2026

Copy link
Copy Markdown
Owner

Task services lose exported files when their containers are removed. The existing tool shared-dir is intentionally temporary. Operators can now attach a pre-existing host directory to an individual service, tool, or custom validator using bind-mounts in the main config. Mounts default to read-only, and MindTrial leaves the source in place when the run ends.

Service inputs can use {{ .ServiceInstance }} to give each attempt its own export path, including retries with the same seed. A ready service now gets up to ten seconds to flush its data before MindTrial collects its final logs and removes the container. A failed stop still triggers resource cleanup. Nothing is automatically exposed to dependent tools.

Validation: go build ./... and go test -tags=test ./... passed locally. Added tests for configuration and mount collisions, runtime errors, retries, validator mounts, and stop failures. The Go workflow also runs a Docker integration test that starts two services and reads their shutdown markers from the host after teardown; no model credentials are required.

Allow services, tools, and custom validators to mount operator-owned
host directories into their Docker containers. Mounts are read-only
unless marked writable, and relative sources resolve beside config.yaml.

```
  bind-mounts:
    - source: ./exports
      target: /exports
      writable: true
```

Before any task starts, the runner verifies that each mount source used
by the selected tasks exists and is a directory. Unused definitions are
not checked. Sources are checked again when containers are created.

Mount targets must not overlap other mounts in the same container,
including tool shared, auxiliary, and parameter-file paths.

Service-input templates can use `{{ .Service.InstanceID }}` to create a
unique per-instance export directory, including across retries.
@petmal
petmal force-pushed the feat/container-bind-mounts branch from ab883f5 to de93e29 Compare November 12, 2026 00:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant